package com.gqz.mapper;


import com.gqz.domain.BlogArticle;
import com.gqz.dto.ArticleDetailDto;
import com.gqz.dto.RelatedArticleDto;
import com.gqz.query.BaseQuery;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * 文章表的顶级持久层
 */
public interface BlogArticleMapper extends Mapper<BlogArticle> {

    /*
     * 批量删除
     * */
    int batchDeleteArticle(@Param("ids") Long[] ids);

    /**
     * 连表查询所有的文章数据
     *
     * @return
     */
    List<BlogArticle> getAllArticle(BaseQuery query);

    int batchDeleteArticleByTypeIds(@Param("ids") Long[] ids);

    /**
     * 归档数据查询
     * @param time
     * @return
     */
    List<BlogArticle> getBlogGdList(@Param("time") String time);

    ArticleDetailDto getArticleDetailById(Long id);

    //根据类型id获取相关文章
    List<RelatedArticleDto> getRelatedArticle(@Param("id") Long id);


}
